package io.github.noahzu.daka

import com.blankj.utilcode.util.CacheDiskUtils

object UserManager {

    fun isLogin() : Boolean {
        return !CacheDiskUtils.getInstance().getString("userName").isNullOrEmpty()
    }

    fun getLoginName() : String {
        return CacheDiskUtils.getInstance().getString("userName")
    }

    fun logout() {
        CacheDiskUtils.getInstance().remove("userName")
    }

    fun saveLogin(userName : String) {
        CacheDiskUtils.getInstance().put("userName",userName)
    }
}